#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	if(0==n%2||0==n%4||0==n%6)
	{
		printf("-1");
	}
	else
	{
		printf("%d",&n);
	}
	return 0;
} 
